//:C16:ValueStackTest.cpp
// {L} SelfCounter
#include "ValueStack.h"
#include "SelfCounter.h"
#include <iostream>
using namespace std;

int main(void)
{
    Stack<SelfCounter> sc;
    for(int i = 0; i < 10; i++)
    {
        sc.push(SelfCounter());
    }
    // Ok to peek(), result is a temporary:
    cout << sc.peek() << endl;
    for(int k = 0; k < 10; k++)
    {
        cout << sc.pop() << endl;
    }
}
